<template>
  <div>
    <h2>我是Count组件</h2>
    <h2>num:{{num}}</h2>
<!--    通过辅助函数实现-->
    <button @click="changeNumAwait({num:10})">点击累加n--辅助函数</button>
  </div>
</template>

<script>
import {mapActions, mapState} from "vuex";

export default {
  name: "Count",
  mounted() {
    console.log(this.$store)
  },
  computed:{
    ...mapState('Count',['num'])
  },
  methods:{
    ...mapActions('Count',['changeNumAwait'])
  }
}
</script>

<style scoped>

</style>